package com.qf.userinformationsystem.service.impl;

import com.qf.userinformationsystem.mapper.UserInfoMapper;
import com.qf.userinformationsystem.pojo.UserInfo;
import com.qf.userinformationsystem.service.UserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Resource
    UserInfoMapper userInfoMapper;
    @Override
    public List<UserInfo> getAll() {
        List<UserInfo> all = userInfoMapper.getAll();
        return all;
    }

    @Override
    public List<UserInfo> getUserByIdNum(String idNum) {
        List<UserInfo> userByIdNum = userInfoMapper.getUserByIdNum(idNum);
        return userByIdNum;
    }

    @Override
    public int insert(UserInfo userInfo) {
        int insert = userInfoMapper.insert(userInfo);
        return insert;
    }

    @Override
    public int update(UserInfo userInfo) {
        int update = userInfoMapper.update(userInfo);
        return update;
    }

    @Override
    public List<UserInfo> searchByFour(String name, Integer age, String sTime, String eTime) {
        List<UserInfo> userInfos = userInfoMapper.searchByFour(name, age, sTime, eTime);
        return userInfos;
    }

    @Override
    public List<UserInfo> getUserByIdAndIdNum(Integer id, String idNum) {
        List<UserInfo> userByIdAndIdNum = userInfoMapper.getUserByIdAndIdNum(id, idNum);
        return userByIdAndIdNum;
    }

    @Override
    public int delete(Integer id, String creator) {
        int delete = userInfoMapper.delete(id, creator);
        return delete;
    }

    @Override
    public int delBatch(String ids,String creator) {
        int i = userInfoMapper.delBatch(ids,creator);
        return i;
    }

    @Override
    public List<UserInfo> getUserByIds(String ids) {
        List<UserInfo> userByIds = userInfoMapper.getUserByIds(ids);
        return userByIds;
    }

    @Override
    public List<Integer> count() {
        List<Integer> count = userInfoMapper.count();
        return count;
    }
}
